1. Field of the Invention
The present invention relates to an image processor, and more particularly, it relates to an image processor converting M-valued image data of a target pixel to N (M>N)-valued image data (N-arization) on the basis of error diffusion.
2. Description of the Related Art
An image processor utilizing error diffusion is known in general. General error diffusion is performed on the basis of the following equation.
Assuming that Ixy (0≦Ixy≦1) represents input image data of a pixel (target pixel) having coordinates (x, y) and Bxy (0 or 1) represents output two-valued image data (N-valued image data), two-valued error data Exy is expressed as follows:Exy=Ixy−Bxy  (1)According to the error diffusion, the image data Ixy of the target pixel is corrected with an average weighted error EAVExy of two-valued errors of peripheral pixels thereof, in order to reduce the two-valued error data Exy on the average. The average weighted error EAVExy is obtained as follows:EAVExy=ΣKxy×Eij  (2)In general, the weighting factor Kij is increased as approaching the target pixel. As shown in FIG. 3, a filter computes the average weighted error EAVExy generally with a matrix size i of five pixels along the main scanning direction of the filter and a matrix size j of two to three pixels along the subscanning direction. The weighting factor Kij is increased as approaching the target pixel (denoted by “*” in FIG. 3).
Corrected image data I′xy of the target pixel is expressed as follows:I′xy=Ixy+EAVExy  (3)The obtained corrected image data I′xy is binarized with a prescribed threshold Th. Bxy=1(when I′xy≧Th)Bxy=0(when I′xy<Th)  (4)
The two-valued error data Exy is computed from the corrected image data I′xy and a reference value B′xy obtained on the basis of the result of binarization (two-valued image data).Exy=I′xy−B′xy  (5)In general, the reference value B′xy is:B′xy=HB(when Bxy=1)B′xy=LB(when Bxy=0)  (6)The reference values HB and LB are given by the upper limit (=1) and the lower limit (=0) of the dynamic range of the pixel respectively.
FIG. 4 is a block diagram showing the structure of a conventional image processor employing error diffusion.
Referring to FIG. 4, the image processor is formed by an error storage memory 1, an error computing part (product-sum operation part) 2 computing errors on the basis of an error weighting filter, an adder 3, a comparator 4, a subtracter 5 and a selector 6.
The error storage memory 1 stores two-valued errors necessary for computing the average weighted error EAVExy. The error storage memory 1 outputs the two-valued errors to the error computing part 2. The error computing part 2 performs a product-sum operation of the weighting factor Kij and the errors for computing the average weighted error EAVExy and outputting the same to the adder 3 (the processing of the above equation (2)).
The adder 3 adds the image data Ixy of the target pixel with the average weighted error EAVExy of the peripheral pixels and computes the corrected image data I′xy. Then, the adder 3 outputs the corrected image data I′xy to the comparator 4 for binarization and the subtracter 5 for error computing (the processing of the above equation (3)).
The comparator 4 compares the corrected image data I′xy with the prescribed threshold Th (e.g. “127”) to obtain the two-valued output Bxy as a result and outputs the result of the comparison to the selector 6 for selecting the reference value (the processing of the above equation (4)).
The subtracter 5 subtracts the corrected image data I′xy from the reference value B′xy and outputs the obtained two-valued error data Exy to the error storage memory 1 (the processing of the above equation (5)).
The selector 6 selects the reference value (HB or LB) for computing the two-valued error data Exy from the two-valued image data Bxy, and outputs the selected reference value B′xy to the subtracter 5.
Referring to FIG. 4, the error computing part 2 computing the average weighted error EAVExy of the peripheral pixels, the adder 3 adding the average weighted error EAVExy to the input image data Ixy and computing the corrected image data I′xy, the comparator 4 comparing the corrected image data I′xy with the threshold Th and computing the two-valued image data Bxy, the selector 6 for selecting the reference value B′xy from the two-valued image data Bxy and the subtracter 5 computing the two-valued error data Exy from the corrected image data I′xy and the reference value B′xy form a feedback loop of errors.
In order to binarize the image data Ixy of the target pixel, the average weighted error EAVExy of the peripheral pixels must be operated inclusive of a two-valued error Ex-1,y of a precedently binarized pixel. In other words, the processing of the above equations (2) to (6) must be entirely performed in a cycle processing a single pixel. If the processing in the feedback loop is performed at a slow speed, therefore, the processing speed of the overall image processor is reduced.